package com.sino.dataworks.repository;

import com.sino.dataworks.entity.DwDutyRoster;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
@author Tison
*/
public interface DwDutyRosterRepository extends JpaRepository<DwDutyRoster, String> {
    @Query(value = " SELECT ddr.DATA_DT AS DATA_DT  ,DDR.FIRST_PHONE AS FIRST_PHONE ,DDR.FIRST_CHARGE_PERSON AS FIRST_CHARGE_PERSON \n" +
            ",DDR.FIRST_PHONE AS SECOND_PHONE ,DDR.FIRST_CHARGE_PERSON AS SECOND_CHARGE_PERSON \n" +
            ",dr.FIRST_PHONE AS THIRD_CHARGE_PERSON  ,dr.THIRD_PHONE AS THIRD_PHONE \n" +
            "FROM ods.DW_DUTY_ROSTER ddr\n" +
            "LEFT JOIN ods.DUTY_ROSTER dr \n" +
            "ON dr.DATA_DT =ddr.DATA_DT " ,nativeQuery = true)
    List<DwDutyRoster> getAllPhone();
    void deleteByDataDt(String dataDt);
}
